package cn.e4j.modular.api.service;


import cn.e4j.core.dto.impl.Dto;
import cn.e4j.modular.api.mapper.JdcxMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * 进度查询
 */
@Service
public class JdcxService{
    @Autowired
    JdcxMapper jdcxMapper;

    public List<Dto> getProgressListData(Page<Object>page, Dto inDto) {
        //return jdcxMapper.getProgressListPage(page,inDto);
        List<Dto> mmra = jdcxMapper.getProgressListPage(page,inDto);
        for(int i=0; i < mmra.size(); i++){
            Dto query = mmra.get(i);
            List<Dto> mmrdDto = jdcxMapper.getMmrdData(query);
            mmra.get(i).put("MMRD014",mmrdDto.get(0).getString("MMRD014"));
            mmra.get(i).put("MMRD020",mmrdDto.get(0).getString("MMRD020"));
            mmra.get(i).put("MMRD022",mmrdDto.get(0).getString("MMRD022"));
        }
        return mmra;
    }

    public List<Dto> getProgressDeatilListPage(Page<Object>page, Dto inDto) {
        return jdcxMapper.getProgressDeatilListPage(page,inDto);
    }
}
